<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@ include file="/commons/nocache.jspf" %>
<%@ taglib uri="/FCKeditor" prefix="FCK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http：//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http：//www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/form.dwt" codeOutsideHTMLIsLocked="true" -->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<script type="text/javascript" src="${ctx}/scripts/datepicker/wpCalendar.js"></script>
<!-- InstanceBeginEditable name="doctitle" -->
<title>稿件管理</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="scripts" -->
<script type="text/javascript">
	function deleteIt(id, page) {
	  if(window.confirm('确定要删除吗?')) {
	  	window.location = "${ctx }/suggest/suggest!delete.action?suggest.id="+id+"&flipPageInfo.page="+page;
	  }  
	}		
	function list(){
		document.pageform.submit();
	}
	function outExcel(){
		document.searchform.action="${ctx}/suggest/suggest!outExcel.action";
		document.searchform.submit();
	}
	function search(){
		document.searchform.action="${ctx}/suggest/suggest!search.action";
		document.searchform.submit();
	}
	function modifyIt(id, isRead){
		document.getElementById("id").value = id;
		document.getElementById("isRead").value = isRead;
		document.modifyform.action="${ctx}/suggest/suggest!modifyPre.action";
		document.modifyform.submit();
	}
	function detailIt(id, isRead){
		document.getElementById("id").value = id;
		document.getElementById("isRead").value = isRead;
		document.modifyform.action="${ctx}/suggest/suggest!detail.action";
		document.modifyform.submit();
	}
	function agreeIt(id){
	/**
		$.ajax({

			url 	 : '${ctx}/suggest/suggest!agree.action?suggest.id='+id,
			dataType : 'json',
			success  : function(json){
					alert("支持成功");
			},
			error	 : function(){
			}
		});
		*/
		window.location = '${ctx}/suggest/suggest!agree.action?suggest.id='+id;
	}
	function detailUnionUserName(name){
		alert(name);
	}
</script>
<!-- InstanceEndEditable -->
</head>

<body>

<div id="main">
	<div class="zdsz" id="select1">
		<div class="tab">

<!-- InstanceBeginEditable name="tab" -->
<c:if test="${role.roleId == ROLE_COMMITTEE}">
	<a href="${ctx}/suggest/suggest!index.action""><h3>添加稿件</h3></a>
</c:if>
<a href="${ctx}/suggest/suggest!list.action"><h3 class="sel">稿件列表</h3></a>

<!-- InstanceEndEditable -->
		</div>
		<div class="zd_gut">
			<ul class="block">
				<li>
		
<!-- InstanceBeginEditable name="form" -->
<form action="${ctx}/suggest/suggest!search.action" method="post" name="searchform">
	<div class="zc_but2">	
		
         稿件总数:
        [ <s:property value="flipPageInfo.total" /> ]
         稿件类别
        <pro:option selectName="s_classify" optionName="suggest.classify.search" value="${s_classify}"/>
         标题:
        <input name="s_theme" type="text" size="18" maxLength="20" value="${s_theme}"/>
         发件人:
        <input name="s_workUnit"  type="text" size="18"  maxlength="20"  value="${s_userName}"/>
         时间：从        
        <input id="startDate" name="startDate" type="text" readOnly class="input01" size="10" maxlength="10" value="<s:date name='startDate' format='yyyy-MM-dd' />"/>
    	<img src="${ctx}/images/main/calendar.gif" align="absmiddle" border="0" style="cursor:hand" onclick="showCalendar(this,document.getElementById('startDate'));" />
    	到
    	<input id="endDate" name="endDate" type="text" readOnly class="input01" size="10" maxlength="10" value="<s:date name='endDate' format='yyyy-MM-dd' />"/>
    	<img src="${ctx}/images/main/calendar.gif" align="absmiddle" border="0" style="cursor:hand" onclick="showCalendar(this,document.getElementById('endDate'));" />
        
        <input name="button"  type="button" onclick="search();" class="log_f zc_b" value="查询"/>
    </div>
</form>
<div id="ErrorName"  align="center"></div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tab_1 center">
	<tr>
	<tr>
  	  <td class="bg4">序号</td>
  	  <td class="bg4">状态</td>
  	  <td class="bg4">发件人</td>
  	  <td class="bg4">标题</td>
	  <td class="bg4">浏览稿件</td>
	  <td class="bg4">日期</td>
	  <td class="bg4">办理情况</td>
	  <td class="bg4">标记/打印</td>
	</tr>
	<s:iterator value="flipPageInfo.data" status="data" id="d">
		<tr>
			<td>${util:chop(flipPageInfo.data[data.index ][4],"20","...")}</td>	
			<td>
				<c:if test="${flipPageInfo.data[data.index ][5] == 'Y'}">已读</c:if>
				<c:if test="${flipPageInfo.data[data.index ][5] == 'N'}"><h5>未读</h5></c:if>
			</td>	
			<td>${util:chop(flipPageInfo.data[data.index ][3],"20","...")}</td>	
			<td>${util:chop(flipPageInfo.data[data.index ][1],"20","...")}</td>	
			<td>
				<a href="#" onclick="detailIt('${flipPageInfo.data[data.index ][0] }', '${flipPageInfo.data[data.index ][5]}');">[查看]</a>
				<c:if test="${role.roleId == ROLE_SUGGEST_MANAGER}">
					<a href="#" onclick="modifyIt('${flipPageInfo.data[data.index ][0] }', '${flipPageInfo.data[data.index ][5]}');">[回复]</a>
					<a href="#" onclick="deleteIt('${flipPageInfo.data[data.index ][0] }','${flipPageInfo.page }');">[删除]</a>
				</c:if>
			</td>
			<td><fmt:formatDate value="${flipPageInfo.data[data.index ][2]}" pattern="yyyy-MM-dd"/></td>
			<td><pro:optionValue optionName="suggest.status" value="${flipPageInfo.data[data.index ][3]}"/></td>	
			<td>
				<c:if test="${flipPageInfo.data[data.index ][6] == 'Y'}">管理员已读</c:if>
				<c:if test="${flipPageInfo.data[data.index ][6] == 'N'}"><h5>管理员未读</h5></c:if>
			</td>	
		</tr>
	</s:iterator>
</table> 

<form action="${ctx}/suggest/suggest!search.action" method="post" name="pageform">
	<div class="fy01" align="center">
		<jsp:include page="/WEB-INF/page/common/page.jsp" />
	</div>
	<input type="hidden" name="flipPageInfo.page" id="page" value="${flipPageInfo.page}" />
    <input type="hidden" name="startDate" value="<s:date name='startDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="endDate" value="<s:date name='endDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="s_theme" value="${s_theme }"/>
	<input type="hidden" name="s_classify" value="${s_classify }"/>
</form>
<form action="${ctx}/suggest/suggest!modifyPre.action" method="post" name="modifyform">

	<input type="hidden" id="id" name="suggest.id" value="${suggest.id }"/>
	<input type="hidden" id="isRead" name="isRead" value="${isRead }"/>
	<input type="hidden" name="flipPageInfo.page" id="page" value="${flipPageInfo.page}" />
    <input type="hidden" name="startDate" value="<s:date name='startDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="endDate" value="<s:date name='endDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="s_theme" value="${s_theme }"/>
	<input type="hidden" name="s_userName" value="${s_userName }"/>
	<input type="hidden" name="s_classify" value="${s_classify }"/>
</form>
</li>
		</ul>
	  </div>
	</div>
</div>
</body>
<!-- InstanceEnd --></html>
